package com.baizhi.service.impl;

import com.baizhi.dao.CmfzLogMapper;
import com.baizhi.entity.CmfzLog;
import com.baizhi.service.CmfzLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class CmfzLogServiceImpl implements CmfzLogService {
    @Autowired
    private CmfzLogMapper cmfzLogMapper;
    @Override
    public Map selectLogDatagrid(int page, int rows) {
        Map map=new HashMap();
        int count=cmfzLogMapper.selectCount();
        map.put("total",count);
        int start=(page-1)*rows;
        List<CmfzLog> cmfzLogs = cmfzLogMapper.selectLogDatagrid(start, rows);
        //创建map集合，把count和bannerList放入map
        map.put("rows",cmfzLogs);
        return map;
    }

    @Override
    public void deleteLogs(int[] ids) {
        cmfzLogMapper.deleteLogs(ids);
    }


}
